home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ttedit / textedit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-04  |  3.2 KB  |  97 lines

  1. VERSION 2.00
  2. Begin Form frmTextEdit 
  3.    AutoRedraw      =   -1  'True
  4.    ClientHeight    =   2055
  5.    ClientLeft      =   3600
  6.    ClientTop       =   3600
  7.    ClientWidth     =   3825
  8.    Height          =   2460
  9.    Icon            =   TEXTEDIT.FRX:0000
  10.    Left            =   3540
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   2055
  13.    ScaleWidth      =   3825
  14.    Top             =   3255
  15.    Width           =   3945
  16.    Begin TextBox txtWordWrap 
  17.       FontBold        =   0   'False
  18.       FontItalic      =   0   'False
  19.       FontName        =   "Fixedsys"
  20.       FontSize        =   9
  21.       FontStrikethru  =   0   'False
  22.       FontUnderline   =   0   'False
  23.       Height          =   615
  24.       HideSelection   =   0   'False
  25.       Left            =   0
  26.       MultiLine       =   -1  'True
  27.       ScrollBars      =   2  'Vertical
  28.       TabIndex        =   1
  29.       Top             =   0
  30.       Visible         =   0   'False
  31.       Width           =   3735
  32.    End
  33.    Begin TextBox txtTextEdit 
  34.       FontBold        =   0   'False
  35.       FontItalic      =   0   'False
  36.       FontName        =   "Fixedsys"
  37.       FontSize        =   9
  38.       FontStrikethru  =   0   'False
  39.       FontUnderline   =   0   'False
  40.       Height          =   1335
  41.       HideSelection   =   0   'False
  42.       Left            =   0
  43.       MultiLine       =   -1  'True
  44.       ScrollBars      =   3  'Both
  45.       TabIndex        =   0
  46.       Top             =   0
  47.       Width           =   3135
  48.    End
  49. Option Explicit
  50. ' Keep the menu in synch with the form
  51. Sub Form_Activate ()
  52.   MDI.mnu_Edit_WordWrap.Checked = txtWordWrap.Visible
  53.   Call EditMenu(True)
  54. End Sub
  55. Sub Form_Deactivate ()
  56.     Call EditMenu(False)
  57. End Sub
  58. ' Make the textboxes handle 64k instead on 32k
  59. Sub Form_Load ()
  60.     If sendMessage(txtTextEdit.hWnd, EM_LIMITTEXT, 0, ByVal 0&) Then
  61.     End If
  62.     If sendMessage(txtWordWrap.hWnd, EM_LIMITTEXT, 0, ByVal 0&) Then
  63.     End If
  64. End Sub
  65. ' Check to see whether the text has changed
  66. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  67.    Dim C As Control
  68.    Dim X As Integer
  69.    Set C = Me.ActiveControl
  70.    If sendMessage(C.hWnd, EM_GETMODIFY, 0, ByVal 0&) Then
  71.       X = MsgBox("The text in " & Caption & " has changed." & Chr(10) & Chr(10) & Chr(13) & "Do you wish to save the changes ?", MB_YESNOCANCEL + MB_ICONEXCLAMATION)
  72.    End If
  73.    Select Case X
  74.      Case IDYES
  75.         Call FileSave
  76.      Case IDCANCEL
  77.         Cancel = True
  78.    End Select
  79. End Sub
  80. ' Make the text boxes fill the form
  81. Sub Form_Resize ()
  82.     txtTextEdit.Width = Scalewidth
  83.     txtTextEdit.Height = ScaleHeight
  84.     txtWordWrap.Width = Scalewidth
  85.     txtWordWrap.Height = ScaleHeight
  86. End Sub
  87. Sub Form_Unload (Cancel As Integer)
  88.     Call Form_Deactivate
  89.     Call DeleteForm(Me)   ' Call the cleanup handler to keep track of each instance
  90. End Sub
  91. Sub txtTextEdit_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  92.     If Button = MK_RBUTTON Then PopupMenu MDI.mnu_Edit, 0, X, Y
  93. End Sub
  94. Sub txtWordWrap_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  95.     If Button = MK_RBUTTON Then PopupMenu MDI.mnu_Edit, 0, X, Y
  96. End Sub
  97.